﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using Macds.Core.Configuration;

namespace Macds.Test.Core.ServiceLocator.Mocks
{
    public class ServiceConfigurationSection : ConfigurationSection
    {
        [ConfigurationProperty("services", IsRequired = true),
        ConfigurationCollection(typeof(GenericElementCollection<ServiceElement>), AddItemName = "service", ClearItemsName = "clear", RemoveItemName = "remove")]
        public GenericElementCollection<ServiceElement> Services
        {
            get { return (GenericElementCollection<ServiceElement>)this["services"]; }
            set { this["services"] = value; }
        }

        public static ServiceConfigurationSection Load()
        {
            return (ServiceConfigurationSection)System.Configuration.ConfigurationManager.GetSection("dependency");
        }
    }
}
